rm(list = ls())
df <- read.csv("appearances.csv")

#models for the paper
Rmodel <- glm(republican ~ repvote04 + swing +  population + democratic + phispanic + pblack + pcollege + punder24 + pseniors + chgpop + medhhinc, data = df[df$battleground == 1,], family = "poisson")

Dmodel <- glm(democratic ~ demvote04 + swing +  population + republican + phispanic + pblack + pcollege + punder24 + pseniors + chgpop + medhhinc, data = df[df$battleground == 1,], family = "poisson")
